\chapter{bsp\+\_\+gpio }
\hypertarget{md_bsp_2gpio_2bsp__gpio}{}\label{md_bsp_2gpio_2bsp__gpio}\index{bsp\_gpio@{bsp\_gpio}}
可以作为io接口,也可以处理外部中断.





使用示例


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{comment}{//在app层只需要设置前三个,callback由module自动设置}}
\DoxyCodeLine{}
\DoxyCodeLine{\mbox{\hyperlink{struct_g_p_i_o___init___config__s}{GPIO\_Init\_Config\_s}}\ gpio\_init\ =\ \{}
\DoxyCodeLine{\ \ \ \ .exti\_mode\ =\ GPIO\_EXTI\_MODE\_FALLING,\ \textcolor{comment}{//\ 注意和CUBEMX的配置一致}}
\DoxyCodeLine{\ \ \ \ .GPIO\_Pin\ =\ GPIO\_PIN\_6,\ \textcolor{comment}{//\ GPIO引脚}}
\DoxyCodeLine{\ \ \ \ .GPIOx\ =\ GPIOG,\ \textcolor{comment}{//\ GPIO外设}}
\DoxyCodeLine{\ \ \ \ .gpio\_model\_callback\ =\ NULL,\ \textcolor{comment}{//\ EXTI回调函数}}
\DoxyCodeLine{\},}
\DoxyCodeLine{}
\DoxyCodeLine{GPIOInstance*\ test\_example\ =\ GPIORegister(\&gpio\_init);}
\DoxyCodeLine{GPIOSet(test\_example);}
\DoxyCodeLine{\textcolor{comment}{//\ GPIOxxx(test\_exmaple,\ ...);}}

\end{DoxyCode}
 